home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / applic / backup / 8mmbackup.shar / README < prev   
Encoding:
Text File  |  1989-11-19  |  14.2 KB  |  308 lines

  1. This README contains a manifest of what exactly is contained in this
  2. distribution, a description of what the system does, and concise
  3. instructions for configuring the system.  A man page that will explain
  4. everything in greater detail is currently being written and will be
  5. released shortly.
  6.  
  7.                   Manifest:
  8.                   --------
  9.  
  10. README -    this file.
  11. 8mmbackup -    driver script, callable from crontab or 'by hand'.
  12. fullPrimer -    link to 8mmbackup, used to prime system for new backup cycle.
  13. fnFilter.awk -    ancillary function used by 8mmbackup, not directly by user.
  14. join.bug -    an interesting bug in join that prevented me from using it for
  15.         a perfect purpose...
  16.  
  17.             What 8mmbackup does:
  18.             -------------------
  19.  
  20. This distribution contains two scripts that together implement a
  21. fairly sophisticated backup mechanism for use with a very high
  22. capacity backup tape device (originally an 8mm exabyte tape drive, as
  23. the name suggests).  It's oriented to take advantage of the capacity
  24. of such backup devices, implementing minimally-intrusive backups such
  25. that system access time and operator management time is kept to a
  26. dramatic minimum.  No restrictions on access to the host system are
  27. necessary during backups and the operator only needs to be involved to
  28. configure the setup and change tapes between each cycle (which can
  29. last for multiple weeks).
  30.  
  31. The system is essentially an elaborate frontend for creating cpio
  32. archives on a high-capacity tape device, managing scheduled backup
  33. cycles consisting of an exhaustive ('full') backup followed by
  34. numerous 'incrementals', which include just those files that have been
  35. modified or created since the prior backup run.  The configurer
  36. designates what directory hierarchies in the file system to save and
  37. what parts to prune from those directory hierarchies.  Comprehensive
  38. online audit tracing and registration of preserved files is
  39. maintained, as well as tape-capacity monitoring and broad operational
  40. error checking and recovery, to ensure that minimal operator
  41. intervention does not mean missed and neglected problems.
  42.  
  43.              What 8mmbackup does not do:
  44.              --------------------------
  45.  
  46. 8mmbackup provides much of the power, with a number of important
  47. advantages, of the standard bsd 4.2 'dump'/'restore' with one important
  48. exception.  8mmbackup does *not* track deletion of files across
  49. incremental backups, so that files that are deleted within the course
  50. of a backup cycle may be resurrected when recovery of the cycle is
  51. effected, even when the recovery goes to a point after the file was
  52. deleted.  The full backups at the beginning of each cycle contain only
  53. what is in the target file system when they are taken, and so establish
  54. a clean, synchronizing image of the target file system.
  55.  
  56. Cpio is used directly to ressurect from the archives created by
  57. 8mmbackup.  The online accounting created during backup provides
  58. comprehensive information for locating particular files within each
  59. backup cycle, and the accounting information for prior cycles are
  60. available from the full backup at the front of the subsequent cycle,
  61. so it is always easy to pinpoint a file or set of target files.  The
  62. accounting information is fairly self-explanatory, you can figure out
  63. what you need to pinpoint any particular file or what has changed on
  64. what date by looking through them, and until the document describing
  65. these things is done that is what you're going to have to do.
  66.  
  67.                 Configuration:
  68.                 -------------
  69.  
  70. Configuration of 8mmbackup is simple and straightforward.  It entails
  71. setting some variables the 8mmbackup script and creating an entry in
  72. the system crontab for periodic activation of the system, all of which
  73. i describe below.  From then on operation of the system is automatic,
  74. except for initialization of each new backup cycle.  This consists of
  75. invoking 'fullPrimer' and replacing the current cycle's tape with a
  76. fresh one.  This does not immediately activate a full backup, but
  77. instead primes the system so that the next backup (either manual or
  78. via cron, etc) will be an exhaustive 'full' dump.  (The effect of
  79. fullPrimer can be cancelled by invoking it again with an 'inhibit'
  80. arg.  Put back in the old tape and use this command if you decide you
  81. want to continue with the incrementals for the current cycle but
  82. you've already prepared the system for a new cycle.)
  83.  
  84. The comments at the beginning of the 8mmbackup script detail
  85. everything you need to know to configure the script.  
  86.  
  87. The following examples in the configurations section assume location of
  88. the scripts in a directory called /usr/local/lib/8mmbackup .  They can
  89. be put instead in an arbitrary directory but will require sufficient
  90. room in the file system where they reside to hold the accounting
  91. information they maintain, which by very rough estimate amounts to
  92. about .013% the volume of the target filesystems when using an
  93. exhaustive registry (see configuration of 8mmbackup below) or about
  94. .00003% of the volume of the target file systems when not using an
  95. exhaustive registry.
  96.  
  97. Here are the specifics:
  98.  
  99. Configuring the 8mmbackup script:
  100. --------------------------------
  101. There is a region in the script that is set aside for definitions of
  102. user-configured variables.  It is delimited above by;
  103.  
  104. #vvvvvvvvvvvvvvvvv User designated (configuration) variables vvvvvvvvvvvvvvvvvv
  105.  
  106. and below by:
  107.  
  108. #^^^^^^^^^^^^^^^^^^ User designated (configuration) variables ^^^^^^^^^^^^^^^^^
  109.  
  110. As it says in the script just after the top delimiter, this section
  111. should be reproduced in a seperate file named by the 'outboardConfig'
  112. variable in this section.  Set the 'outboardConfig' and 'scriptDir'
  113. vars in the main script and then duplicate the entire section in the
  114. outboardConfig file.
  115.  
  116. Here are some hints about configuring the script.
  117.  
  118. Each variable definition is preceded by an explanation in comments and
  119. a default value, some of which will almost certainly have to be
  120. changed for your site, and some of which are probably best left as
  121. they are.  Here's the variables one by one:
  122.  
  123. 'scriptDir': the directory where the backup scripts (including this
  124. one) reside.
  125.  
  126. Example: 'set scriptDir=/usr/local/lib/8mmbackup'
  127.  
  128. 'outboardConfig': a config file you can create that will override all
  129. settings (except 'scriptDir' and 'outboardConfig' settings themselves)
  130. in the main script.  Useful to easily accomodate new versions of the
  131. script without losing your site-specific configurations.
  132.  
  133. 'debug': Generally left undefined, setting this variable causes the
  134. script to run in a dry-run mode, with no accounting information or tape
  135. backups actually getting written.  Setting it to a null value is useful
  136. for diagnosing where problems occur during a run, and setting it to the
  137. value 'verbose' is useful for seeing exactly what happens during the
  138. run - perhaps seeing more than you want to, however.  Verbose is very
  139. verbose.  In either case no accounting information or tape backup will
  140. be written.
  141.  
  142. Example: 'set debug' or 'set debug=verbose'
  143. As shipped: '#set debug' (ie, inhibited)
  144.  
  145. 'subjPaths': a list of the top of directory hierarchies that you want
  146. backed up.  Wild cards can be used here.  'excludePaths' and
  147. 'excludeBaseNames' (described below) can be used to prune branches out
  148. of the designated target hierarchies.
  149.  
  150. Example: 'set subjPaths=(/ /usr/spool/{mail,mqueue})'
  151.  
  152. 'excludePaths': specific rooted paths to directories whose contents
  153. are to be excluded from backup.  Wild cards are also valid here.  Note
  154. that it will *not* help to include in 'subjPaths' (above) a path to a
  155. directory that is contained somewhere in a directory hierarchy
  156. included in 'excludePaths' - that subdirectory will still be excluded.
  157. Any paths that start with a path specified in 'excludePaths' (and
  158. their unravelled equivalents; see next paragraph) will be excluded
  159. from backup.  However, symbolic links from elsewhere to a file
  160. actually residing in an excluded path will not cause the files to be
  161. saved - the links themselves will be, but not the files.  Hard links
  162. from non-excluded paths, however, will cause the files to be saved.
  163.  
  164. Example: 'set excludePaths=(/usr/man/cat* /remote/{poobah,humbug,mogul})'
  165. As shipped: 'set excludePaths=(/usr/man/cat*)'
  166.  
  167. One other note about these two path variables - any symbolic links
  168. mentioned in them are first 'unravelled' to the hard directories that
  169. they denote so that the path to the actual directory will be used as
  170. well as the path to the link.
  171.  
  172. 'excludeDirs': pathless names of those directories whose contents
  173. should always be excluded from backup, eg 'tmp'.  In contrast to the
  174. way 'excludePaths' works, you *can* make contents of 'excludeDirs'
  175. excluded directories get included in backup by explicitly specifying
  176. them in 'subjectPaths'.  For instance, we exclude 'spool' directories
  177. via 'excludeDirs' but explicitly add '/usr/spool/{mail,mqueue}' as
  178. part of our subject paths.  This way the mail related spool
  179. directories on the backup machine are preserved, but other spool
  180. directories are not.
  181.  
  182. Example: 'set excludeDirs=(tmp newsgroups spool lost+found)'
  183.  
  184. 'exhaustiveRegistry': A registry of preserved files is maintained
  185. which indicates the paths of the files preserved within the current
  186. backup cycle and the specific backups during which they were
  187. preserved.  'exhaustiveRegistry' controls whether that file is to
  188. contain only the paths of files that have been modified since the
  189. prior backup (full or incremental regardless) or whether it is to
  190. contain a roster of all the files.  The distinction only concerns
  191. those files preserved during the full backup that had not been
  192. modified since the last backup of the prior cycle.  With
  193. 'exhaustiveRegistry' set all the paths are registered and without it
  194. set only the recently modified ones are registered - this doesn't
  195. affect what gets saved, only what gets registered.  The rationale for
  196. having an exhaustive registry is obvious - the registry reflects
  197. what's on tape.  The rationale against has to do with online space
  198. savings (about a factor of 500 in size, or 40 kilobytes for a 1
  199. gigabyte target file hierarcy for non-exhaustive vs about 20 megabytes
  200. for exhaustive) from a smaller registry.  I'm quite comfortable with a
  201. non-exhaustive registry, but a number of people around here elect for
  202. an exhaustive one.  In either case the registry entries are marked to
  203. indicate during which backup(s) in the cycle they were preserved and
  204. whether they had been recently modified.
  205.  
  206. Example: 'set exhaustiveRegistry'
  207. As shipped: '#set exhaustiveRegistry' (inhibited)
  208.  
  209. 'realDev': the device that should receive the backup.  This should
  210. always be a no-rewind tape device (ie, one that can be manipulated with
  211. 'mt' commands).  Exabyte drives as configured with Perfect Byte
  212. software are '/dev/nrrt0' - 'rt0' being the device and 'nr' being the
  213. no-rewind specification.
  214.  
  215. Example: 'set realDev=/dev/nrrt0'
  216. As shipped: 'set realDev=/dev/nrst1'
  217.  
  218. 'totalCap': total capacity (in bytes) that a single backup device
  219. volume (tape) will hold.  We use 2200000000 (2.2 billion) for the
  220. exabyte drive.
  221.  
  222. Example: 'set totalCap=2200000000'
  223.  
  224. 'errorNoticeTo': a username that any backup error notifications should
  225. be sent to.  You may want to establish a mail alias on your backup
  226. server that can be directed to a few users and be visible as a general
  227. resource, like with the 'Postmaster' alias.
  228.  
  229. As shipped: 'set errorNoticeTo=backupmaster'
  230.  
  231. 'verifyTolerance': If set a fairly stringent but time consuming
  232. validation of the tape archive is done at the end of processing,
  233. If unset a much less assured but much faster verification is done.
  234. See the notes in the configuration section for more details.
  235.  
  236.  
  237. That is all the user-configured variables in the 8mmbackup script -
  238. nothing else should be changed there unless you want to really hack on
  239. it...
  240.  
  241. Commissioning 8mmbackup for scheduled execution:
  242. -----------------------------------------------
  243. 8mmbackup is designed to be run either as a shell command from a
  244. terminal or automatically by invocation from the 'cron' service.
  245. Normal operation is generally via 'cron', with operator intervention
  246. to prime the system for full backup, by (1) changing the tape, and (2)
  247. invoking fullPrimer.  The next time 8mmbackup is invoked (with no
  248. specific arguments) it will do a full backup.  Thus a single cron entry
  249. will suffice for both full and incremental backups.
  250.  
  251. Assuming location of the scripts in a /usr/local/lib/8mmbackup
  252. directory, a crontab entry that runs 8mmbackup every evening at 10:45
  253. would be:
  254.  
  255. 45 22 * * * /usr/local/lib/8mmbackup/8mmbackup
  256.  
  257. Reading the accounting:
  258. ----------------------
  259.  
  260. If the configuration variable 'exhaustiveRegistry' is left unset in
  261. the configuration, the accounting file 'registry' details either just
  262. those files in the current backup cycle that were modified since the
  263. previous backup, along with the specific sequence id numbers of the
  264. the backups in the cycle they were taken on.  With 'exhaustiveRegistry'
  265. set the registry includes the pathname of every file that was included,
  266. with all the files included in the full marked with an underscore ('_')
  267. and those files included in the full but and modified distinguished
  268. from the others by a '0' sequence id.  This may sound complicated, but
  269. it's obvious when you look at the registry.
  270.  
  271. The accounting file 'backup.log' details the trace of each backup run.
  272. backup.log is not reinitted at the beginning of each backup cycle.
  273.  
  274. The accounting file 'seqStats' details the association between sequence
  275. id and date, archive size, and any other pertinent parameters of each
  276. run.  SeqStats is reinitted at the beginning of each backup cycle.
  277.  
  278.  
  279. Reading the archives:
  280. --------------------
  281. I define some aliases in the 8mmbackup script that exemplify a general
  282. way to access the 8mmdevice - 
  283.  
  284. alias 8mmin dd if='\!\!:1' ibs=5120
  285. alias 8mmout dd of='\!\!:1' obs=5120
  286.  
  287. If you want to read in an archive, change to a directory where you
  288. want the paths that you're resurrecting to be rooted.  *Note* that the
  289. entire path will come in, so, eg, if you restore in to the root
  290. directory the files will overwrite any existing versions of them.  In
  291. general it's best to resurrect in a temporary directory where you
  292. won't unintentionally overwrite something.  The path of the directory
  293. where you execute the cpio prepended to the entire path where they
  294. exist.
  295.  
  296. Using the aliases above, position to the archive you want to read
  297. using 'mt' - eg, for the seventh backup in device /dev/nrst1:
  298.  
  299. mt -f /dev/nrst1 fsf 7
  300. cd /enough/space/tmp
  301. dd if=/dev/nrst1 ibs=5120 | cpio -ivd "*/spiffy/path/stuff/*"
  302. [numerous messages]
  303.  
  304.  
  305.  
  306.  
  307. klm@cme.nist.gov
  308.